package top.wnma.crud.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import top.wnma.crud.dao.DepartmentDao;
import top.wnma.crud.pojo.Department;
import top.wnma.crud.service.IDepartmentService;

@Service
@Transactional
public class DepartmentServiceImpl implements IDepartmentService {

	@Autowired
	private DepartmentDao departmentDao;

	public void save(Department entity) {
		departmentDao.save(entity);
	}

	public void delete(Department entity) {
		departmentDao.delete(entity);
	}

	public void update(Department entity) {
		departmentDao.update(entity);
	}

	public void saveOrUpdate(Department entity) {
		departmentDao.saveOrUpdate(entity);
	}

	public Department findById(Serializable id) {
		return departmentDao.findById(id);
	}

	public List<Department> findAll() {
		return departmentDao.findAll();
	}
	
	

}
